<template lang="">
    <div>
        <div class="table-body-box">
            <div class="study-center-form">
                <el-form style="margin-left:60px;margin-top:25px;" :inline="true">
                     <el-form-item label="计划名称：">
                        <el-input
                        style="width:193px;"
                        clearable
                        size="small"
                        placeholder="请输入内容"
                        v-model="planObj.planName">
                        </el-input>
                    </el-form-item>
                    <el-form-item label="年份：">
                        <el-date-picker
                          v-model="planObj.planYear"
                          align="right"
                          type="year"
                          size="small"
                          value-format="yyyy"
                          placeholder="选择年">
                        </el-date-picker>
                    </el-form-item>
                </el-form>
                <div class="btn-box">
                    <!-- <el-button type="primary" @click="searchList(1,10)" :loading="searchLoading" size="small">通过</el-button> -->
                    <el-button type="primary" @click="checkApply = true" size="small">上传</el-button>
                    <el-button type="primary" @click="searchList(1,10)" :loading="searchLoading" size="small">查询</el-button>
                </div>
            </div>
            <div class="study-center-table">
                <el-table 
                row-class-name="greyRow"
                height="70vh"
                :data="tableData" 
                style="width: 100%" 
                @selection-change="handleSelectionChange"
                :header-cell-style="{background:'#4787E3',color:'#ffffff'}">
                <!-- <el-table-column
                    type="selection"
                    width="55">
                </el-table-column> -->
                  <el-table-column show-overflow-tooltip prop="planName" label="计划名称" align="center">
                  </el-table-column>
                  <el-table-column show-overflow-tooltip prop="planYear" label="年份" align="center">
                  </el-table-column>
                  <el-table-column
                    align="center"
                    fixed="right"
                    label="操作" 
                    width="140">
                  <template slot-scope="scope">
                      <!-- <el-button style="text-decoration:underline;" type="text" @click="applyClick(scope.row)" size="small">查看</el-button> -->
                      <el-button style="text-decoration:underline;" type="text" @click="deleteClick(scope.row)" size="small">删除</el-button>
                  </template>
                  </el-table-column>
                </el-table>
                <div class="study-center-pagination flex-row">
                  <pagination 
                    @pageTurnNum="pageNum" 
                    @pageTurnSize="pageSizeNum" 
                    :total="total"></pagination>
                </div>
            </div>
        </div>
        <el-dialog
        title="培训计划上传"
        :close-on-click-modal='false'
        :visible.sync="checkApply"
        width="800px"
        @closed="diloagClose"
        :before-close="handleClose">
          <div v-loading="smallLoading" class="class-detail-box">
                <div style="margin-bottom:25px;" class="tips-box">
                    <div class="class-tips">培训计划信息</div>
                </div>
                <div class="teacher">
                    <el-form
                        style="padding-left: 99px;"
                        label-width='120px'
                        ref="planForm" 
                        :model="planUpload" 
                        :rules="planRules" 
                    >
                        <el-form-item style="margin-bottom:20px;" prop="planName" label="计划名称：">
                            <el-input
                                clearable
                                size="small"
                                placeholder="请输入内容"
                                v-model="planUpload.planName">
                            </el-input>
                        </el-form-item>
                        <el-form-item style="margin-bottom:20px;" prop="planYear" label="年度：">
                            <el-date-picker
                                v-model="planUpload.planYear"
                                align="right"
                                type="year"
                                size="small"
                                value-format="yyyy"
                                placeholder="选择年">
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item style="margin-top:20px;" label="培训计划：">
                            <el-upload
                            style="width:300px;"
                            class="upload-demo"
                            ref="uploads"
                            action="#"
                            accept=".xlsx,.xls,.doc,.docx"
                            :limit='1'
                            :on-exceed='limitNums'
                            :on-remove="limitRemoves"
                            :on-change="addAttachments"
                            :file-list="fileListMenus"
                            :auto-upload="false">
                            <!-- <i style="padding:0 20px;" slot="trigger" class="el-icon-plus"></i> -->
                            <el-button slot="trigger" size="small" type="default">选取文件</el-button>
                            </el-upload>
                            <P class="text">文件格式（.xlsx,.xls,.doc,.docx），请保证文件格式正确</P>
                        </el-form-item>
                    </el-form>
                </div>
            </div>
        <div style="text-align:center;padding:36px 0 26px 0;">
          <span slot="footer"  class="dialog-footer">
              <el-button size="small" :loading="disAgree"  @click="checkApply = false">取 消</el-button>
              <el-button size="small" :loading="agree" type="primary" @click="apply">确 定</el-button>
          </span>
        </div>
        </el-dialog>
    </div>
</template>
<script src="./studyjs/plan"></script>
<style lang="less" scoped>
@import url("~@/pagecss/studyCenter");
@import url("~@/pagecss/classApply");
</style>